package com.gujiangbo.application.database.service;

import com.gujiangbo.application.info.OrderInfo;
import com.gujiangbo.application.info.SubAccount;
import com.gujiangbo.application.req.SelectOrderInVo;
import com.gujiangbo.application.req.UserInfoInVo;
import com.gujiangbo.application.rsp.SelectOrderOutVo;

import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface OperateDataBaseService {

    /**
     * 查询单条数据记录，orderID唯一
     *
     * @param request
     * @return
     * @throws Exception
     */
    OrderInfo selectOrder(SelectOrderInVo request);

    /**
     * 新增收件人账号信息
     *
     * @param account
     * @throws Exception
     */
    boolean insertSubAccount(SubAccount account);

    /**
     * 更新收件人账号信息
     *
     * @param account
     * @throws Exception
     */
    boolean updateSubAccount(SubAccount account);


    /**
     * 保存订单信息
     *
     * @param info
     * @throws Exception
     */
    boolean saveOrderInfo(OrderInfo info);

    /**
     * 查询收件人信息
     *
     * @param account
     * @return
     */
    SubAccount selectSubAccount(SubAccount account);

    /**
     * 根据订购者账号查询订单信息
     *
     * @param subAccount
     * @return
     */
    List<OrderInfo> queryOrderInfoBySubAccount(String subAccount);
    
    /**
     * 查询用户信息
     * @param userInfoInVo
     * @return
     */
    UserInfoInVo queryUserInfo(UserInfoInVo userInfoInVo);

    /**
     * 添加用户信息
     * @param userInfoInVo
     * @return
     */
    boolean addUserInfo(UserInfoInVo userInfoInVo);

}
